package com.wiegand.content.contents {
	import com.caurina.transitions.Tweener;
	import com.wiegand.content.AbstractContent;
	import com.wiegand.gui.text.CssTextSprite;

	import flash.display.Sprite;

	/**
	 * @author gandy
	 */
	 
	public class Home extends AbstractContent {
		public function Home(xml:XMLList) {
			super(xml);
		}
		
		
		override public function init() : void {
			_container = new Sprite();
			_container.alpha = 0;
			addChild(_container);
			 
			var t : Sprite = CssTextSprite.create( String(_xml.text), "logo"  );
			t.x = t.y = 300;
			_container.addChild(t);
		}
		
		override public function open(delay : Number = 0) : void {
			Tweener.removeTweens(_container);
			Tweener.addTween(_container,{alpha:1,delay:delay,time:1,transition:"linear",onComplete:callOpen});
		}
		
		override public function close(delay : Number = 0) : void {
			Tweener.removeTweens(_container);
			Tweener.addTween(_container,{alpha:0,delay:delay,time:1,transition:"linear",onComplete:callClosed});
		}
		
		override public function destroy() : void {
			Tweener.removeTweens(_container);
			removeChild(_container);
		}
		
	}
}
